﻿using UnityEngine;
using System.Collections;

namespace GJXQGame
{
    public class PlayInfoWin : GUIBase
    {
        private GameObject mChessPiecesObj;
        public PlayInfoWin(GUIManager gMrg)
            : base(gMrg)
        {
            _layer = GUILAYER.ROOT;
            _id = GUI_ID.GUI_ID_PLAYINFOWIN;
            _path = "Windows/PlayInfoWin/UI Root (3D)";
        }

        protected override void OnCreate()
        {
            base.OnCreate();
            mChessPiecesObj = mGUIObject.transform.FindChild("PlayInfoWin/PlayDataObj/ChessPiecesObj").gameObject;
            PlayinfoSpawner.GetInstance().InitChessChessObj(mChessPiecesObj.transform);
            //UIEventListener.Get(FindChild("BtnClose").gameObject).onClick = target => { if (!_scrolling) MainClient.StartCoroutine(ScrollLeft()); };
            UIEventListener.Get(FindChild("PlayInfoWin/BtnClose").gameObject).onClick = OnClose;
        }

        private void OnPlay(GameObject Obj)
        {
        }

        public void OnClose(GameObject Obj)
        {
            GameManager.SceneManager.ChangeScene(SCENE_ID.SCENE_MAIN_HOME, SCENE_STYLE.MAIN);
        }

    }

}
